﻿using System;
using System.Text;

class Max20CharsStringFilledWithAsterix
{
    static void Main()
    {
        //Exercise 6.
        //Write a program that reads from the console a string of maximum 20 characters. If the length of the string is less than 20, 
        //the rest of the characters should be filled with '*'. Print the result string into the console.

        //IF YOU'D LIKE, YOU MAY TYPE YOUR TEXT HERE:
        //Console.Write("Type the text: ");
        //string text = Console.ReadLine();

        string text = "This is sample text";
        if (text.Length > 20)
        {
            Console.WriteLine("The string should be maximum of 20 characters.");
        }
        else if (text.Length == 20)
        {
            Console.WriteLine("The string is exactly 20 characters.");
        }

        StringBuilder result = new StringBuilder();
        for (int i = 0; i < text.Length; i++)
        {
            result.Append(text[i]);
        }
        result.Append('*', (20 - text.Length));
        Console.WriteLine(result);
    }
}

